<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>预算文件上传</title>
    <link href="/res/inspinia/css/bootstrap.min.css" rel="stylesheet">
    <link href="/res/inspinia/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="/res/inspinia/css/plugins/dropzone/basic.css" rel="stylesheet">
    <link href="/res/inspinia/css/plugins/dropzone/dropzone.css" rel="stylesheet">
    <link href="/res/inspinia/css/animate.css" rel="stylesheet">
    <link href="/res/inspinia/css/style.css" rel="stylesheet">
</head>
<body class="mini-navbar fixed-sidebar">
<div id="wrapper">

    <div id="page-wrapper" class="white-bg">
        <div class="ibox">
            <div class="ibox-content">
                <form action="#" class="dropzone" id="dropzoneForm">
                    <div class="fallback">
                        <input name="file" type="file" multiple/>
                    </div>
                </form>

                <p class="m-t-xs">
                <h3>注意事项：<a class="small" href="/res/download/budget_import.xlsx" target="_blank">模板下载</a></h3>
                <ol>
                    <li>仅导入第一个标签页的内容</li>
                    <li>模板中背景为“黄色”的内容不要修改，“合计”列为公式计算，新建行时请复制整行</li>
                    <li>“部门名称”从第一个不为空的行开始，之前为空的行不会导入，之后为空的行将使用上一个不为空的部门名称</li>
                    <li>“预算项目”不能为空</li>
                    <li>填入的预算必须为数字型</li>
                </ol>
                </p>
            </div>
        </div>
    </div>
</div>
<script src="/res/inspinia/js/jquery-3.1.1.min.js"></script>
<script src="/res/inspinia/js/bootstrap.js"></script>
<!-- DROPZONE -->
<script src="/res/inspinia/js/plugins/dropzone/dropzone.js"></script>
<script type="text/javascript">
    Dropzone.options.dropzoneForm = {
        url: "/budget/tbudgetinfodetail/importDetail",
        paramName: "file", // The name that will be used to transfer the file
        maxFilesize: 10, // MB
        parallelUploads: 1,
        dictDefaultMessage: "<strong>拖动文件到此处或点击上传。</strong>",
        success: function (file, rsp) {
            if (rsp.code == 0) {
                uploadSuccess();
            } else {
                uploadFail(rsp.msg);
            }
        }
    };

    function uploadSuccess(){
        window.parent.uploadOver(true, "操作成功");
    }

    function uploadFail(msg){
        window.parent.uploadOver(false, msg);
    }
</script>
</body>
</html>